import { createWebHistory, createRouter } from 'vue-router'

//导入组件
import Home from '../views/Home.vue'
import Login from '../views/user/Login.vue'
//配置路径关系
const routes = [
  { 
    path: '/', 
    name: 'Home',
    component: Home,
    children:[
        { path: '/user',name: 'user', component: () => import('../views/user.vue') },
    ]
 },
  { path: '/login', component: Login },
]

//将创建的配置关系挂载到router实例上
const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router